#ifndef GY_StateToolButton_H
#define GY_StateToolButton_H

#include "GY_ControlLibrary_global.h"
#include "GroupControl/GY_GroupControl.h"
#include <QToolButton>
#include <QVariant>

/** 自定义工具按钮
 * @brief The GY_StateToolButton class
 */
class GY_CONTROLLIBRARY_EXPORT GY_StateToolButton : public QToolButton
{
    Q_OBJECT
public:
    explicit GY_StateToolButton(QWidget *parent = nullptr);

    /**
     * @brief setButtonGroupValue 设置组号
     * @param groupId 组号
     */
    void setButtonGroupValue(const QVariant groupId);
    /**
     * @brief getButtonGroupValue 获取组号
     * @return 获取的组号
     */
    QVariant getButtonGroupValue();
    /**
     * @brief setCheckedState 设置按钮互斥状态
     */
    void setButtonExclusiveState(const bool ischecked);
    /**
     * @brief changeButtonState 改变按钮按下状态
     */
    Q_INVOKABLE void changeButtonState();

signals:
    void sendButtonInfo(GY_StateToolButton* pButton);
    void sendButtonStateChanged(GY_StateToolButton* pButton);

private slots:
    void rcvClicked(bool isClicked); //点击响应

private:
    QVariant m_groupId;
};

#endif // GY_StateToolButton_H
